/*
 * receiver.h
 *
 *  Created on: 2011-7-24
 *      Author: minorityee1984@gmail.com
 *     Purpose: CReceiverBase, 數據接收器基類
 *        Note:
 */

#ifndef RECEIVER_H_
#define RECEIVER_H_

#include "type_def.h"
#include "adapter.h"

class CReceiverBase
{
public:
	CReceiverBase();
	virtual ~IReceiver(){}

	// 初始化Receiver
	virtual int Initialize() = 0;
	// 销毁Receiver
	virtual int Uninitialize() = 0;
/*
 * Purpose: 接收数据
 *    Args: pszBuf 传入缓冲区指针，接受到的数据将写入这个缓冲区
 *          uLen 传入缓冲区大小，传出实际写入的大小
 *  Return：错误码
 *    Note:
 */
	virtual uint16_t Receive(Byte *pszBuf, uint16_t &uLen) = 0;

	void SetSourceID(int nSouceID)
	{
		m_nSourceID = nSouceID;
	}
	int GetSourceID()
	{
		return m_nSourceID;
	}
private:
	int m_nSourceID;
};

#endif /* RECEIVER_H_ */
